package com.chendx.store.order.config;

import com.chendx.store.order.mq.listener.OrderNoticeListener;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by chendx on 2021/9/29.
 */
@Configuration
public class OrderRabbitConfig {
    @Bean("orderNoticeContainer")
    public SimpleMessageListenerContainer createSys(ConnectionFactory connectionFactory) {
        SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
        container.setExposeListenerChannel(true);
        container.setMessageListener(new OrderNoticeListener());
        return container;
    }
}
